home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Especial Multimedia
/
Especial Multimedia.iso
/
Multimed
/
Prg
/
LED102.ZIP
/
LEDTEST.FRM
< prev
next >
Wrap
Text File
|
1997-09-14
|
15KB
|
528 lines
VERSION 2.00
Begin Form ledtest
BackColor = &H00C0C0C0&
Caption = "LED Examples"
ClientHeight = 4635
ClientLeft = 1290
ClientTop = 2100
ClientWidth = 8460
Height = 5010
Left = 1245
LinkTopic = "Form1"
ScaleHeight = 8.176
ScaleMode = 0 'User
ScaleWidth = 14.923
Top = 1770
Width = 8550
Begin CommandButton Command1
Caption = "&VBX Info"
Height = 495
Left = 6570
TabIndex = 22
Top = 3900
Width = 1755
End
Begin Frame Frame4
BackColor = &H00C0C0C0&
Caption = "Max Decay Ex."
Height = 3375
Left = 6600
TabIndex = 16
Top = 330
Width = 1695
Begin LED LED5
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 0 ' 0 - None
BevelWidth = 2
BorderHorizontal= 2
BorderVertical = 2
BorderWidth = 2
DecayRate = 50
Direction = 1 ' 1 - Backward
Height = 3000
Index = 3
LEDHeight = 6
LEDIndex = 0
LEDSep = 0
LEDStyle = 0 ' 0 - Rectangular
LEDWidth = 15
Left = 1050
MaxDecay = -1 'True
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 32
Orientation = 1 ' 1 - Vertical
TabIndex = 20
Top = 330
Value = 0
Width = 345
End
Begin LED LED5
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 0 ' 0 - None
BevelWidth = 2
BorderHorizontal= 2
BorderVertical = 2
BorderWidth = 2
DecayRate = 50
Direction = 1 ' 1 - Backward
Height = 3000
Index = 2
LEDHeight = 6
LEDIndex = 0
LEDSep = 0
LEDStyle = 0 ' 0 - Rectangular
LEDWidth = 15
Left = 780
MaxDecay = -1 'True
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 32
Orientation = 1 ' 1 - Vertical
TabIndex = 19
Top = 330
Value = 0
Width = 345
End
Begin LED LED5
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 0 ' 0 - None
BevelWidth = 2
BorderHorizontal= 2
BorderVertical = 2
BorderWidth = 2
DecayRate = 50
Direction = 1 ' 1 - Backward
Height = 3000
Index = 1
LEDHeight = 6
LEDIndex = 0
LEDSep = 0
LEDStyle = 0 ' 0 - Rectangular
LEDWidth = 15
Left = 510
MaxDecay = -1 'True
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 32
Orientation = 1 ' 1 - Vertical
TabIndex = 18
Top = 330
Value = 0
Width = 345
End
Begin LED LED5
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 0 ' 0 - None
BevelWidth = 2
BorderHorizontal= 2
BorderVertical = 2
BorderWidth = 2
DecayRate = 50
Direction = 1 ' 1 - Backward
Height = 3000
Index = 0
LEDHeight = 6
LEDIndex = 0
LEDSep = 0
LEDStyle = 0 ' 0 - Rectangular
LEDWidth = 15
Left = 240
MaxDecay = -1 'True
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 32
Orientation = 1 ' 1 - Vertical
TabIndex = 17
Top = 330
Value = 0
Width = 345
End
End
Begin Timer Timer1
Interval = 100
Left = 5070
Top = 60
End
Begin LED LED4
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 1 ' 1 - Raised
BevelWidth = 2
BorderHorizontal= 2
BorderVertical = 0
BorderWidth = 0
DecayRate = 0
Direction = 0 ' 0 - Forward
Height = 480
LEDHeight = 28
LEDIndex = 0
LEDSep = 2
LEDStyle = 2 ' 2 - Bitmap
LEDWidth = 25
Left = 300
MaxDecay = 0 'False
Mode = 0 ' 0 - Value
MouseControl = -1 'True
NumLEDs = 15
OffPictureGreen = LEDTEST.FRX:0000
OffPictureRed = LEDTEST.FRX:01CA
OffPictureYellow= LEDTEST.FRX:0394
OnPictureGreen = LEDTEST.FRX:055E
OnPictureRed = LEDTEST.FRX:0728
OnPictureYellow = LEDTEST.FRX:08F2
Orientation = 0 ' 0 - Horizontal
TabIndex = 15
Top = 3930
Value = 0
Width = 6165
End
Begin LED LED3
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 2 ' 2 - Inset
BevelWidth = 2
BorderHorizontal= 0
BorderVertical = 2
BorderWidth = 2
DecayRate = 60
Direction = 0 ' 0 - Forward
Height = 570
LEDHeight = 26
LEDIndex = 0
LEDSep = 0
LEDStyle = 2 ' 2 - Bitmap
LEDWidth = 24
Left = 60
MaxDecay = 0 'False
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 15
OffPictureGreen = LEDTEST.FRX:0ABC
OffPictureRed = LEDTEST.FRX:0C86
OffPictureYellow= LEDTEST.FRX:0E50
OnPictureGreen = LEDTEST.FRX:101A
OnPictureRed = LEDTEST.FRX:11E4
OnPictureYellow = LEDTEST.FRX:13AE
Orientation = 0 ' 0 - Horizontal
TabIndex = 14
Top = 1110
Value = 0
Width = 5520
End
Begin LED LED1
AutoSize = 0 'False
BackColor = &H00C0C0C0&
BackgroundPicture= LEDTEST.FRX:1578
BevelInner = 0 ' 0 - None
BevelOuter = 1 ' 1 - Raised
BevelWidth = 2
BorderHorizontal= 20
BorderVertical = 1
BorderWidth = 4
DecayRate = 30
Direction = 1 ' 1 - Backward
Height = 3315
LEDHeight = 11
LEDIndex = 0
LEDSep = 0
LEDStyle = 0 ' 0 - Rectangular
LEDWidth = 11
Left = 5610
MaxDecay = 0 'False
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 15
Orientation = 1 ' 1 - Vertical
TabIndex = 13
Top = 390
Value = 0
Width = 915
End
Begin Frame Frame3
BackColor = &H00C0C0C0&
Caption = "Direction"
Height = 1185
Left = 3450
TabIndex = 10
Top = 2430
Width = 1605
Begin OptionButton Option3
BackColor = &H00C0C0C0&
Caption = "Backward"
Height = 255
Index = 1
Left = 210
TabIndex = 12
Top = 630
Width = 1245
End
Begin OptionButton Option3
BackColor = &H00C0C0C0&
Caption = "Forward"
Height = 255
Index = 0
Left = 210
TabIndex = 11
Top = 360
Width = 1245
End
End
Begin Frame Frame2
BackColor = &H00C0C0C0&
Caption = "Mode"
Height = 1155
Left = 1980
TabIndex = 6
Top = 2430
Width = 1365
Begin OptionButton Option2
BackColor = &H00C0C0C0&
Caption = "Bitwise"
Height = 195
Index = 1
Left = 210
TabIndex = 8
Top = 630
Width = 1125
End
Begin OptionButton Option2
BackColor = &H00C0C0C0&
Caption = "Value"
Height = 195
Index = 0
Left = 210
TabIndex = 7
Top = 390
Width = 1065
End
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "LEDStyle"
Height = 1155
Left = 270
TabIndex = 2
Top = 2430
Width = 1635
Begin OptionButton Option1
BackColor = &H00C0C0C0&
Caption = "Bitmap"
Height = 225
Index = 2
Left = 180
TabIndex = 5
Top = 810
Width = 1305
End
Begin OptionButton Option1
BackColor = &H00C0C0C0&
Caption = "Circular"
Height = 225
Index = 1
Left = 180
TabIndex = 4
Top = 570
Width = 1185
End
Begin OptionButton Option1
BackColor = &H00C0C0C0&
Caption = "Rectangle"
Height = 225
Index = 0
Left = 180
TabIndex = 3
Top = 330
Width = 1335
End
End
Begin HScrollBar HScroll1
Height = 255
Left = 180
Max = 15
TabIndex = 1
Top = 1770
Width = 5325
End
Begin LED LED2
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BevelInner = 0 ' 0 - None
BevelOuter = 2 ' 2 - Inset
BevelWidth = 3
BorderHorizontal= 10
BorderVertical = 2
BorderWidth = 2
DecayRate = 0
Direction = 0 ' 0 - Forward
Height = 510
LEDHeight = 20
LEDIndex = 0
LEDSep = 2
LEDStyle = 1 ' 1 - Circular
LEDWidth = 20
Left = 180
MaxDecay = 0 'False
Mode = 0 ' 0 - Value
MouseControl = 0 'False
NumLEDs = 15
Orientation = 0 ' 0 - Horizontal
TabIndex = 0
Top = 480
Value = 0
Width = 5370
End
Begin Label Label2
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Current Value:"
Height = 195
Left = 1200
TabIndex = 21
Top = 180
Width = 1230
End
Begin Label Label1
Caption = "Label1"
Height = 165
Left = 2490
TabIndex = 9
Top = 210
Width = 1485
End
End
Dim theta(5) As Single
Dim rates(5) As Single
Sub Command1_Click ()
On Error Resume Next
i = Shell("winhelp instrum.hlp", 1)
End Sub
Sub Form_Load ()
Randomize
For i = 0 To 4
theta(i) = Rnd(1) * 3.14159
rates(i) = .2 * Rnd(1)
Next
For i = 0 To 8
led1.LEDIndex = i
led1.LEDColor = 2
led2.LEDIndex = i
led2.LEDColor = 2
led3.LEDIndex = i
led3.LEDColor = 2
led4.LEDIndex = i
led4.LEDColor = 2
Next
For i = 9 To 12
led1.LEDIndex = i
led1.LEDColor = 1
led2.LEDIndex = i
led2.LEDColor = 1
led3.LEDIndex = i
led3.LEDColor = 1
led4.LEDIndex = i
led4.LEDColor = 1
Next
For i = 13 To 15
led1.LEDIndex = i
led1.LEDColor = 0
led2.LEDIndex = i
led2.LEDColor = 0
led3.LEDIndex = i
led3.LEDColor = 0
led4.LEDIndex = i
led4.LEDColor = 0
Next
label1 = ""
End Sub
Sub HScroll1_Change ()
led1.Value = Hscroll1
led2.Value = Hscroll1
led3.Value = Hscroll1
led4.Value = Hscroll1
label1 = led2.Value
End Sub
Sub HScroll1_Scroll ()
led1.Value = Hscroll1
led2.Value = Hscroll1
led3.Value = Hscroll1
led4.Value = Hscroll1
label1 = led2.Value
End Sub
Sub LED4_Click ()
If led4.Value <= Hscroll1.Max Then
Hscroll1 = led4.Value
Else
label1 = led4.Value
End If
End Sub
Sub Option1_Click (index As Integer)
led4.LEDStyle = index
End Sub
Sub Option2_Click (index As Integer)
led4.Mode = index
If index = 1 Then
j = led4.NumLEDs - 1
If j > 31 Then j = 31
End If
End Sub
Sub Option3_Click (index As Integer)
led4.Direction = index
End Sub
Sub Timer1_Timer ()
For i = 0 To 3
Randomize
led5(i) = 32 * Sin(theta(i)) ^ 2
theta(i) = theta(i) + rates(i)
Next
End Sub